/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package GUI;

import Gestores.GestorCliente;
import javax.swing.ImageIcon;

/**
 *
 * @author Jose
 */
public class CarcelD extends javax.swing.JDialog {

    private GestorCliente gestorCliente;
    private boolean suerte;
    private boolean arca;
    
    public CarcelD(java.awt.Frame parent, boolean modal, GestorCliente gestorCliente, boolean pagar, boolean suerte, boolean arca, boolean tirar, String nickname) {
        super(parent, modal);
        this.setUndecorated(true);
        initComponents();
        this.gestorCliente = gestorCliente;
        this.suerte = suerte;
        this.arca = arca;
        jPagar.setEnabled(pagar);
        jUsarTarjeta.setEnabled(this.suerte || this.arca);
        jTirarDados.setEnabled(tirar);
        jLabel1.setText(nickname);
        this.getRootPane().putClientProperty("Synthetica.titlePane.enabled", false);
        setLocationRelativeTo(null);
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();
        jImagenCarcel = new javax.swing.JLabel();
        jTirarDados = new javax.swing.JButton();
        jPagar = new javax.swing.JButton();
        jUsarTarjeta = new javax.swing.JButton();
        jFondo = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setMinimumSize(new java.awt.Dimension(380, 290));
        setResizable(false);
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowClosing(java.awt.event.WindowEvent evt) {
                formWindowClosing(evt);
            }
        });
        getContentPane().setLayout(null);

        jLabel1.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        jLabel1.setForeground(new java.awt.Color(51, 51, 255));
        jLabel1.setText("NombreDelJugador");
        getContentPane().add(jLabel1);
        jLabel1.setBounds(140, 10, 120, 40);

        jImagenCarcel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/Botones/CARCELIMAGEN.jpg"))); // NOI18N
        getContentPane().add(jImagenCarcel);
        jImagenCarcel.setBounds(90, 10, 215, 205);

        jTirarDados.setBackground(new java.awt.Color(51, 0, 255));
        jTirarDados.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/Botones/TIRARDADOSCARCEL ON.png"))); // NOI18N
        jTirarDados.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
        jTirarDados.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                jTirarDadosMouseReleased(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                jTirarDadosMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                jTirarDadosMouseExited(evt);
            }
            public void mousePressed(java.awt.event.MouseEvent evt) {
                jTirarDadosMousePressed(evt);
            }
        });
        jTirarDados.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTirarDadosActionPerformed(evt);
            }
        });
        getContentPane().add(jTirarDados);
        jTirarDados.setBounds(270, 240, 100, 40);

        jPagar.setBackground(new java.awt.Color(102, 102, 255));
        jPagar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/Botones/PAGARCARCEL.png"))); // NOI18N
        jPagar.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                jPagarMouseReleased(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                jPagarMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                jPagarMouseExited(evt);
            }
            public void mousePressed(java.awt.event.MouseEvent evt) {
                jPagarMousePressed(evt);
            }
        });
        jPagar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jPagarActionPerformed(evt);
            }
        });
        getContentPane().add(jPagar);
        jPagar.setBounds(10, 240, 100, 40);

        jUsarTarjeta.setBackground(new java.awt.Color(51, 51, 255));
        jUsarTarjeta.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/Botones/USARTARJETA.png"))); // NOI18N
        jUsarTarjeta.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                jUsarTarjetaMouseReleased(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                jUsarTarjetaMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                jUsarTarjetaMouseExited(evt);
            }
            public void mousePressed(java.awt.event.MouseEvent evt) {
                jUsarTarjetaMousePressed(evt);
            }
        });
        jUsarTarjeta.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jUsarTarjetaActionPerformed(evt);
            }
        });
        getContentPane().add(jUsarTarjeta);
        jUsarTarjeta.setBounds(140, 240, 100, 40);

        jFondo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/Botones/FONDOCARCEL.jpg"))); // NOI18N
        getContentPane().add(jFondo);
        jFondo.setBounds(0, 0, 380, 290);

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jUsarTarjetaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jUsarTarjetaActionPerformed
        // TODO add your handling code here:
        gestorCliente.salirCarcelTarjeta(this.suerte, this.arca);
    }//GEN-LAST:event_jUsarTarjetaActionPerformed

    private void jPagarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jPagarActionPerformed
        gestorCliente.salirCarcelPagando();
    }//GEN-LAST:event_jPagarActionPerformed

    private void jTirarDadosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTirarDadosActionPerformed
        gestorCliente.tirarDadosCarcel();
    }//GEN-LAST:event_jTirarDadosActionPerformed

    private void formWindowClosing(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosing
        gestorCliente.tirarDadosCarcel();
    }//GEN-LAST:event_formWindowClosing

    private void jPagarMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jPagarMouseEntered
        if(jPagar.isEnabled())
        {
        jPagar.setIcon(new ImageIcon(getClass().getResource("/Imagenes/Botones/PAGARCARCEL SEL.png")));
        }
    }//GEN-LAST:event_jPagarMouseEntered

    private void jPagarMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jPagarMouseExited
        if(jPagar.isEnabled())
        {
        jPagar.setIcon(new ImageIcon(getClass().getResource("/Imagenes/Botones/PAGARCARCEL.png")));
        }
    }//GEN-LAST:event_jPagarMouseExited

    private void jPagarMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jPagarMousePressed
        if(jPagar.isEnabled())
        {
        jPagar.setIcon(new ImageIcon(getClass().getResource("/Imagenes/Botones/PAGARCARCEL OFF.png")));
        }
    }//GEN-LAST:event_jPagarMousePressed

    private void jPagarMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jPagarMouseReleased
        if(jPagar.isEnabled())
        {
        jPagar.setIcon(new ImageIcon(getClass().getResource("/Imagenes/Botones/PAGARCARCEL.png")));
        }
    }//GEN-LAST:event_jPagarMouseReleased

    private void jUsarTarjetaMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jUsarTarjetaMouseEntered
        if(jUsarTarjeta.isEnabled())
        {
        jUsarTarjeta.setIcon(new ImageIcon(getClass().getResource("/Imagenes/Botones/USARTARJETA SEL.png")));
        }
    }//GEN-LAST:event_jUsarTarjetaMouseEntered

    private void jUsarTarjetaMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jUsarTarjetaMouseExited
        if(jUsarTarjeta.isEnabled())
        {
        jUsarTarjeta.setIcon(new ImageIcon(getClass().getResource("/Imagenes/Botones/USARTARJETA.png")));
        }
    }//GEN-LAST:event_jUsarTarjetaMouseExited

    private void jUsarTarjetaMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jUsarTarjetaMousePressed
        if(jUsarTarjeta.isEnabled())
        {
        jUsarTarjeta.setIcon(new ImageIcon(getClass().getResource("/Imagenes/Botones/USARTARJETA OFF.png")));
        }
    }//GEN-LAST:event_jUsarTarjetaMousePressed

    private void jUsarTarjetaMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jUsarTarjetaMouseReleased
        if(jUsarTarjeta.isEnabled())
        {
        jUsarTarjeta.setIcon(new ImageIcon(getClass().getResource("/Imagenes/Botones/USARTARJETA.png")));
        }
    }//GEN-LAST:event_jUsarTarjetaMouseReleased

    private void jTirarDadosMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTirarDadosMouseEntered
        if(jTirarDados.isEnabled())
        {
        jTirarDados.setIcon(new ImageIcon(getClass().getResource("/Imagenes/Botones/TIRARDADOSCARCEL SEL.png")));
        }
    }//GEN-LAST:event_jTirarDadosMouseEntered

    private void jTirarDadosMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTirarDadosMouseExited
        if(jTirarDados.isEnabled())
        {
        jTirarDados.setIcon(new ImageIcon(getClass().getResource("/Imagenes/Botones/TIRARDADOSCARCEL ON.png")));
        }
    }//GEN-LAST:event_jTirarDadosMouseExited

    private void jTirarDadosMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTirarDadosMousePressed
        if(jTirarDados.isEnabled())
        {
        jTirarDados.setIcon(new ImageIcon(getClass().getResource("/Imagenes/Botones/TIRARDADOSCARCEL OFF.png")));
        }
    }//GEN-LAST:event_jTirarDadosMousePressed

    private void jTirarDadosMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTirarDadosMouseReleased
        if(jTirarDados.isEnabled())
        {
        jTirarDados.setIcon(new ImageIcon(getClass().getResource("/Imagenes/Botones/TIRARDADOSCARCEL ON.png")));
        }
    }//GEN-LAST:event_jTirarDadosMouseReleased

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel jFondo;
    private javax.swing.JLabel jImagenCarcel;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JButton jPagar;
    private javax.swing.JButton jTirarDados;
    private javax.swing.JButton jUsarTarjeta;
    // End of variables declaration//GEN-END:variables
}
